﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace OAuth2Authorizer.StackExchange
{
    [DataContract]
    internal class StackExchangeAccessToken
    {
        [DataMember(Name = "access_token")]
        public string AccessToken { get; set; }

        [DataMember(Name = "expires")]
        public string Expires { get; set; }

        public AccessTokenResponse AsAccessTokenResponse()
        {
            var accessToken = new AccessTokenResponse(AccessToken, string.Empty);
            accessToken.ResponseTokens.Add("expires", Expires);
            return accessToken;
        }
    }
}
